package com.wwp.tbshop.model.adapter;

import android.support.v4.view.PagerAdapter;
import android.view.View;
import android.view.ViewGroup;

import com.wwp.tbshop.activity.HotProductsActivity;
import com.wwp.tbshop.model.bean.HotProductBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by ${wenping} on 6/17/2017.
 */

public class HotProductViewPagerAdapter extends PagerAdapter{

    private HotProductsActivity mHotProductsActivity;

    public HotProductViewPagerAdapter(HotProductsActivity hotProductsActivity) {
        mHotProductsActivity = hotProductsActivity;
    }

    private List<HotProductBean.ProductListBean> productList = new ArrayList<>();
    public void setData(List<HotProductBean.ProductListBean> list) {
        productList = list;
    }

    @Override
    public int getCount() {
        if (productList==null) {
            return 0;
        }
        return productList.size();
    }

    @Override
    public boolean isViewFromObject(View view, Object object) {
        return view == object;
    }

    @Override
    public Object instantiateItem(ViewGroup container, int position) {
//        View view = m
        return null;
    }

    public void destroyItem(ViewGroup container, int position, Object object) {
        destroyItem((View) container, position, object);
    }
}
